package com.wsjj.yjh;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ListSource {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        ArrayList<Integer> data1 = new ArrayList<>();
        data1.add(1);
        data1.add(2);
        data1.add(3);
        List<Integer> data = Arrays.asList(1, 2, 3, 4);
        DataStreamSource<Integer> ds = env.fromCollection(data);
        ds.print();

        env.execute();
    }
}
